package Study0;
import java.util.Scanner;
/* 对Java的方法的探究使用*/
public class Study1 {
    /* 求三个数值的最大值的进一步探究*/
    public static void main (String[] args) {
        int max = max4(max4(1,10),100);
        System.out.println("最大值为："+max);
    }

    public static int max4(int x,int y) {
        if( x > y) {
            return x;
        } else {
            return y;
        }
    }



    /*求三个数值的最大值的探究*/
    public static void main4 (String[] args) {
        Study1 max3 = new Study1();
        int num = max3(1,10,100);
        System.out.println("最大值为："+num);
    }

    public static int max3 (int x,int y ,int c) {
        int max = x > y ? x : y ;
        max = max > c ? max : c;
        return max;
    }


    /*求返回一个最大值的进一步探究*/
    public static void main3 (String[] args) {
        Study1 max = new Study1();
        int num = max.max1(0,99);
        System.out.println("最大值为："+num);
    }
    
    public static int max2 (int x,int y) {
        return x > y ? x : y;
    }
    
    
    
    /*求返回一个最大值*/
    public static void main2 (String[] args) {
        int num = max1(99,100);
        System.out.println("最大值为："+num);
    }
    public static int max1 (int x,int y) {
        return x > y ? x : y;
    }





    public static void main1 (String[] args) {
        Scanner scanner = new Scanner(System.in);
        int num1 = 0;
        int num2 = 0;
        if(scanner.hasNextInt()) {
             num1 = scanner.nextInt();
        }
        if(scanner.hasNextInt()) {
             num2 = scanner.nextInt();
        }

        int max = maxNum(num1,num2);
        System.out.println("max= "+max);

        scanner.close(); // 关闭IO流

    }

    public static int maxNum(int x,int y) {
        return x > y ? x : y ;
    }

}
